home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Dialogs.h < prev    next >
Text File  |  1991-05-01  |  5KB  |  186 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, January 8, 1991 at 1:03 PM
  4.     Dialogs.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.     1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __DIALOGS__
  15. #define __DIALOGS__
  16.  
  17. #ifndef __GEOMETRY__
  18. #include <Geometry.h>
  19. #endif
  20.  
  21. #ifndef __WINDOWS__
  22. #include <Windows.h>
  23. #endif
  24.  
  25. #ifndef __TEXTEDIT__
  26. #include <TextEdit.h>
  27. #endif
  28.  
  29.  
  30. enum {
  31.  
  32.     ctrlItem = 4,
  33.     btnCtrl = 0,
  34.     chkCtrl = 1,
  35.     radCtrl = 2,
  36.     resCtrl = 3,
  37.     statText = 8,
  38.     editText = 16,
  39.     iconItem = 32,
  40.     picItem = 64,
  41.     userItem = 0,
  42.     itemDisable = 128,
  43.     ok = 1,
  44.     cancel = 2,
  45.     stopIcon = 0,
  46.     noteIcon = 1,
  47.     cautionIcon = 2
  48. };
  49.  
  50. typedef short StageList;
  51. typedef WindowPtr DialogPtr;
  52. typedef pascal void (*ResumeProcPtr)(void);
  53. typedef pascal void (*SoundProcPtr)(void);
  54. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord& theEvent, short& itemHit);
  55.  
  56. struct DialogRecord {
  57.     WindowRecord window;
  58.     Handle items;
  59.     TEHandle textH;
  60.     short editField;
  61.     short editOpen;
  62.     short aDefItem;
  63. };
  64.  
  65. typedef DialogRecord *DialogPeek;
  66.  
  67. struct DialogTemplate {
  68.     Rect boundsRect;
  69.     short procID;
  70.     Boolean visible;
  71.     Boolean filler1;
  72.     Boolean goAwayFlag;
  73.     Boolean filler2;
  74.     long refCon;
  75.     short itemsID;
  76.     Str255 title;
  77. };
  78.  
  79. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  80.  
  81. struct AlertTemplate {
  82.     Rect boundsRect;
  83.     short itemsID;
  84.     StageList stages;
  85. };
  86.  
  87. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  88.  
  89.  
  90. #ifdef __cplusplus
  91. extern "C" {
  92. #endif
  93. pascal void InitDialogs(ResumeProcPtr resumeProc)
  94.     = 0xA97B; 
  95. pascal void ErrorSound(SoundProcPtr soundProc)
  96.     = 0xA98C; 
  97. pascal DialogPtr NewDialog(void *wStorage,const Rect& boundsRect,ConstStr255Param title,
  98.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  99.     Handle itmLstHndl)
  100.     = 0xA97D; 
  101. DialogPtr newdialog(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  102.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  103. pascal DialogPtr GetNewDialog(short dialogID,void *dStorage,WindowPtr behind)
  104.     = 0xA97C; 
  105. pascal void CloseDialog(DialogPtr theDialog)
  106.     = 0xA982; 
  107. pascal void DisposDialog(DialogPtr theDialog)
  108.     = 0xA983; 
  109. pascal void DisposeDialog(DialogPtr theDialog)
  110.     = 0xA983; 
  111. pascal void CouldDialog(short dialogID)
  112.     = 0xA979; 
  113. pascal void FreeDialog(short dialogID)
  114.     = 0xA97A; 
  115. pascal void ParamText(ConstStr255Param param0,ConstStr255Param param1,ConstStr255Param param2,
  116.     ConstStr255Param param3)
  117.     = 0xA98B; 
  118. pascal void ModalDialog(ModalFilterProcPtr filterProc,short& itemHit)
  119.     = 0xA991; 
  120. pascal Boolean IsDialogEvent(const EventRecord& theEvent)
  121.     = 0xA97F; 
  122. pascal Boolean DialogSelect(const EventRecord& theEvent,DialogPtr& theDialog,
  123.     short& itemHit)
  124.     = 0xA980; 
  125. pascal void DrawDialog(DialogPtr theDialog)
  126.     = 0xA981; 
  127. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  128.     = 0xA978; 
  129. pascal void UpdateDialog(DialogPtr theDialog,RgnHandle updateRgn)
  130.     = 0xA978; 
  131. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  132.     = 0xA985; 
  133. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  134.     = 0xA986; 
  135. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  136.     = 0xA987; 
  137. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  138.     = 0xA988; 
  139. pascal void CouldAlert(short alertID)
  140.     = 0xA989; 
  141. pascal void FreeAlert(short alertID)
  142.     = 0xA98A; 
  143. pascal void GetDItem(DialogPtr theDialog,short itemNo,short& itemType,Handle& item,
  144.     Rect& box)
  145.     = 0xA98D; 
  146. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  147.     const Rect& box)
  148.     = 0xA98E; 
  149. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  150.     = 0xA827; 
  151. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  152.     = 0xA828; 
  153. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  154.     = 0xA97E; 
  155. pascal void GetIText(Handle item,Str255& text)
  156.     = 0xA990; 
  157. pascal void SetIText(Handle item,ConstStr255Param text)
  158.     = 0xA98F; 
  159. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  160.     = 0xA984; 
  161. pascal DialogPtr NewCDialog(void *dStorage,const Rect& boundsRect,ConstStr255Param title,
  162.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  163.     Handle items)
  164.     = 0xAA4B; 
  165. DialogPtr newcdialog(void *dStorage,const Rect *boundsRect,char *title,
  166.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  167.     Handle items); 
  168. #define GetAlrtStage() (* (short*) 0x0A9A)
  169. pascal void ResetAlrtStage(void)
  170.     = {0x4278,0x0A9A}; 
  171. pascal void DlgCut(DialogPtr theDialog); 
  172. pascal void DlgPaste(DialogPtr theDialog); 
  173. pascal void DlgCopy(DialogPtr theDialog); 
  174. pascal void DlgDelete(DialogPtr theDialog); 
  175. pascal void SetDAFont(short fontNum)
  176.     = {0x31DF,0x0AFA}; 
  177. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  178. void getitext(Handle item,char *text); 
  179. void setitext(Handle item,char *text); 
  180. short findditem(DialogPtr theDialog,Point *thePt); 
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184.  
  185. #endif
  186.